package test.ygqh.baby.service;

import com.ygqh.baby.ao.PayType;
import com.ygqh.baby.observer.Observable.OrderPaySuccessObservable;
import com.ygqh.baby.observer.OrderPayModel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.math.BigDecimal;

/**
 * 〈〉
 *
 * @author guohao
 * @date 2019/1/8 12:21
 * @since 1.0.0
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:spring/*.xml" })
public class PaySuccessObserver {
    @Autowired
    private OrderPaySuccessObservable orderPaySuccessObservable;

    @Test
    public  void test(){
        OrderPayModel payModel = new OrderPayModel();
        payModel.setOrderId(190107358454L);
        payModel.setPaymentCode("190107150649");
        payModel.setPayType(PayType.WeChat);
        payModel.setTotalPrice(BigDecimal.ONE);
        orderPaySuccessObservable.paySuccess(payModel);
    }
}
